package com.example.hibernate.model.repository;

import java.util.List;

import com.example.hibernate.model.bll.DepartmentBLL;
import com.example.hibernate.model.entity.Department;

public class Departments {

	private final DepartmentBLL departmentBLL;

	public Departments() {
		this.departmentBLL = new DepartmentBLL();
	}

	public boolean insertDepartment(Department entity) {
		return departmentBLL.insertEntity(entity);
	}

	public boolean updateDepartment(Department entity) {
		return departmentBLL.updateEntity(entity);
	}

	public boolean deleteDepartment(Department entity) {
		// throw new
		// UnsupportedOperationException("Department cannot be deleted!");
		return departmentBLL.deleteEntity(entity);
	}

	public List<Department> getAllDepartments() {
		return departmentBLL.getAllEntity();
	}

	public Department findDepartmentById(long id) {
		return departmentBLL.findEntityById(id);
	}

}
